﻿<UserControl 
  x:Class="AppLab.MainPage"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation" 
  xmlns:uriMapper="clr-namespace:System.Windows.Navigation;assembly=System.Windows.Controls.Navigation"
  xmlns:dataControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.DataForm.Toolkit" 
  xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
  mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="600"
  xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit">

    <toolkit:BusyIndicator x:Name="busyIndicatorNetWork" BusyContent="{Binding Path=ApplicationStrings.BusyIndicatorNetWork, Source={StaticResource ResourceWrapper}}">
        <Grid x:Name="LayoutRoot" Style="{StaticResource LayoutRootGridStyle}">
            <Border x:Name="ContentBorder" Style="{StaticResource ContentBorderStyle}">
                <navigation:Frame x:Name="ContentFrame" Style="{StaticResource ContentFrameStyle}" 
                            Navigated="ContentFrame_Navigated" NavigationFailed="ContentFrame_NavigationFailed" Source="/History" >
                    <navigation:Frame.UriMapper>
                        <uriMapper:UriMapper>
                            <uriMapper:UriMapping Uri="" MappedUri="/Views/History.xaml"/>
                            <uriMapper:UriMapping Uri="/{pageName}" MappedUri="/Views/{pageName}.xaml"/>
                        </uriMapper:UriMapper>
                    </navigation:Frame.UriMapper>
                </navigation:Frame>
            </Border>

            <Grid Style="{StaticResource NavigationOuterGridStyle}">
                <Grid x:Name="NavigationGrid" Style="{StaticResource NavigationGridStyle}">
                    <Border x:Name="BorderLogo" HorizontalAlignment="Left" VerticalAlignment="Top" Height="55" Width="Auto" Margin="35,0,0,0">
                        <Image Name="logo" Source="/AppLab;component/Images/dx.png" HorizontalAlignment="Left"></Image>
                    </Border>
                    <Border x:Name="BrandingBorder" Style="{StaticResource BrandingBorderStyle}">
                        <StackPanel x:Name="BrandingStackPanel" Style="{StaticResource BrandingStackPanelStyle}">
                            <TextBlock x:Name="ApplicationNameTextBlock" Style="{StaticResource ApplicationNameStyle}" 
                               Text="{Binding ApplicationStrings.ApplicationName, Source={StaticResource ResourceWrapper}}"/>
                        </StackPanel>
                    </Border>

                    <Border x:Name="LinksBorder" Style="{StaticResource LinksBorderStyle}" Background="#FF37AFFF">
                        <StackPanel x:Name="LinksStackPanel" Style="{StaticResource LinksStackPanelStyle}">

                            <HyperlinkButton Style="{StaticResource LinkStyle}" Name="HistoryLinkButton" NavigateUri="/History"
                                     TargetName="ContentFrame" Content="{Binding Path=ApplicationStrings.HistoryPageTitle, Source={StaticResource ResourceWrapper}}"/>

                            <HyperlinkButton Style="{StaticResource LinkStyle}" Name="TerminalInfoLinkButton" Click="TerminalInfoLinkButton_Click"
                                     TargetName="ContentFrame" Content="{Binding Path=ApplicationStrings.TerminalInfoPageTitle, Source={StaticResource ResourceWrapper}}"/>

                            <HyperlinkButton Style="{StaticResource LinkStyle}" Name="SubmitLinkButton" Click="SubmitLinkButton_Click"
                                     TargetName="ContentFrame" Content="{Binding Path=ApplicationStrings.SubmitPageTitle, Source={StaticResource ResourceWrapper}}"/>

                            <HyperlinkButton Style="{StaticResource LinkStyle}" Name="ReviewLinkButton" Click="ReviewLinkButton_Click"
                                     TargetName="ContentFrame" Content="{Binding Path=ApplicationStrings.ReviewPageTitle, Source={StaticResource ResourceWrapper}}" />

                            <HyperlinkButton Style="{StaticResource LinkStyle}" Name="TaskLinkButton" Click="TaskLinkButton_Click"
                                     TargetName="ContentFrame" Content="{Binding Path=ApplicationStrings.TaskPageTitle, Source={StaticResource ResourceWrapper}}"/>

                            <HyperlinkButton Style="{StaticResource LinkStyle}" Name="PublishLinkButton" Click="PublishLinkButton_Click"
                                     TargetName="ContentFrame" Content="{Binding Path=ApplicationStrings.PublishPageTitle, Source={StaticResource ResourceWrapper}}"/>

                            <HyperlinkButton Style="{StaticResource LinkStyle}" Name="RoleLinkButton" Click="RoleLinkButton_Click"
                                     TargetName="ContentFrame" Content="{Binding Path=ApplicationStrings.RolePageTitle, Source={StaticResource ResourceWrapper}}"/>

                            <!--<HyperlinkButton Style="{StaticResource LinkStyle}" 
                                     NavigateUri="/About" TargetName="ContentFrame" Content="{Binding Path=ApplicationStrings.AboutPageTitle, Source={StaticResource ResourceWrapper}}"/>-->

                        </StackPanel>
                    </Border>
                </Grid>

                <Border x:Name="loginContainer" Style="{StaticResource LoginContainerStyle}">
                    <!-- LoginStatus will be added here in code behind. This is required for the designer view to work -->
                </Border>
            </Grid>

        </Grid>
    </toolkit:BusyIndicator>
</UserControl>